package models

import (
	"gopkg.in/mgo.v2/bson"
)

type Video struct {
	Vid           bson.ObjectId `bson:"_id"`
	Title         string        `bson:"title"`         //文字内容
	PublisherID   string        `bson:"publisherId"`   //发布者id
	PublishedTime string        `bson:"publishedTime"` //发布时间
	URL           string        `bson:"url"`
	Image         string        `bson:"image"`
	Comments      []Comment     `bson:"comments"` //评论
	Likes         []Like        `bson:"likes"`    //点赞
}

type Reply struct {
	Rid         bson.ObjectId `bson:"_id"`
	Content     string        `bson:"content"`     //评论内容
	PublisherId string        `bson:"publisherId"` //评论者id
}

type Comment struct {
	Cid           bson.ObjectId `bson:"_id"`
	Content       string        `bson:"content"`       //评论内容
	PublisherId   string        `bson:"publisherId"`   //评论者id
	PublisherName string        `bson:"publisherName"` //评论者name
	PublishedTime string        `bson:"publishedTime"`
	//Replys []Reply `bson:"replys"`
}

type Like struct {
	Lid     bson.ObjectId `bson:"_id"`
	LikerId string        `bson:"likerid"` //点赞者id
}

type VideosReq struct {
	Title string `bson:"title"`
}

type VideoRes struct {
	Vid           bson.ObjectId `bson:"_id"`
	Title         string        `bson:"title"`
	PublisherID   string        `bson:"publisherId"`
	PublishedTime string        `bson:"publishedTime"`
	URL           string        `bson:"url"`
	Image         string        `bson:"image"`
	Comments      []Comment     `bson:"comments"`
	LikeNames     []string      `bson:"likeNames"`
	PublisherName string        `bson:"publisherName"`
	LikeSum       string        `bson:"likesum"`
	CommentSum    string        `bson:"commentsum"`
	//Likes         []Like        `bson:"likes"`
}

type CommentReq struct {
	VideoId string `bson:"videoid"`
	Content string `bson:"content"` //评论内容
	//PublishedTime string `bson:"publishedTime"`
}

type LikeReq struct {
	VideoId string `bson:"videoid"`
}
